package com.lighting.module3;

import java.text.NumberFormat;
import java.util.Locale;

public class Calculator {
    //字段
    double p;  //本金
    int m;     //月份
    double yr; //年利率

    //构造函数
    public Calculator(double p, int m, double yr) {
        this.p = p;
        this.m = m;
        this.yr = yr;
    }

    //普通方法
    String[] CreateRow(int i, double payment, double payPrincipal, double payInterest) {
        String[] row = new String[]{
                (i + 1) + "",
                NumberFormat.getCurrencyInstance(Locale.CHINA).format(payment),
                NumberFormat.getCurrencyInstance(Locale.CHINA).format(payPrincipal),
                NumberFormat.getCurrencyInstance(Locale.CHINA).format(payInterest),
                NumberFormat.getCurrencyInstance(Locale.CHINA).format(p)
        };
        return row;
    }

    String[] cal(){
        return null;
    }

    String[][] details(){
        return null;
    }
}
